/**
 * @file Thread.h
 * @Synopsis
 * @author Mingyu Wu
 * @version 1.0.0
 * @date 2024-04-20
 */
#ifndef _THREAD_H_
#define _THREAD_H_
#include "../Util.h"

#include <thread>
#include <unordered_map>
#include <vector>

class Thread {
  public:
    Thread();
    virtual ~Thread();
    virtual int  Init() = 0;
    void         Start();
    virtual void Run() = 0;

    void Join();
    void JoinAll();

  protected:
  private:
    static std::vector<std::thread> threads;
    std::thread                     thread;
    bool                            isRunning;
};
#endif // !_THREAD_H_
